

using System.Linq;
using Abp;
using Abp.Authorization;
using Abp.Configuration.Startup;
using Abp.Localization;
using Abp.MultiTenancy;
using WebApp.Authorization;

namespace WebApp.Authorization
{
    /// <summary>
    /// 权限配置都在这里。
    /// 给权限默认设置服务
    /// See <see cref="MenuElementPermissions" /> for all permission names. MenuElement
    ///</summary>
    public class MenuElementAuthorizationProvider : AuthorizationProvider
    {
        private readonly bool _isMultiTenancyEnabled;

		public MenuElementAuthorizationProvider()
		{

		}

       
        public MenuElementAuthorizationProvider(bool isMultiTenancyEnabled)
        {
            _isMultiTenancyEnabled = isMultiTenancyEnabled;
        }

        public MenuElementAuthorizationProvider(IMultiTenancyConfig multiTenancyConfig)
        {
            _isMultiTenancyEnabled = multiTenancyConfig.IsEnabled;
        }

		public override void SetPermissions(IPermissionDefinitionContext context)
		{
			// 在这里配置了MenuElement 的权限。


									context.CreatePermission(MenuElementPermissions.Node , L("MenuElement"));
									context.CreatePermission(MenuElementPermissions.Query, L("QueryMenuElement"));
									context.CreatePermission(MenuElementPermissions.Create, L("CreateMenuElement"));
									context.CreatePermission(MenuElementPermissions.Edit, L("EditMenuElement"));
									context.CreatePermission(MenuElementPermissions.Delete, L("DeleteMenuElement"));
									context.CreatePermission(MenuElementPermissions.BatchDelete, L("BatchDeleteMenuElement"));
									

			
							//// custom codes
									
							

							//// custom codes end
		}

		private static ILocalizableString L(string name)
		{
			return new LocalizableString(name, AbpConsts.LocalizationSourceName);
		}
    }
}
